using System;
using System.Collections.Generic;
using System.Text;

using System.Data;
using System.Data.Common;
using Husb.Data;
using Husb.DataUtil;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Caching;

using CentralOffice.MyTable.Data;

using NotifyTable = CentralOffice.MyTable.Data.NotifyDataSet.NotifyDataTable;
using NotifyRow = CentralOffice.MyTable.Data.NotifyDataSet.NotifyRow;
namespace CentralOffice.MyTable.DataAccess
{
    public class NotifyAdapter : DataAccessAdapter<MyTable.Data.NotifyDataSet, NotifyTable, NotifyRow>
    {
        public NotifyAdapter()
        {
            this.TableName = "Notify";
            DeleteStoredProc = "Notify_DeleteNotify";

            GetAllStoredProc = "Notify_SelectNotifyAll";
            InsertStoredProc = "Notify_InsertNotify";
            UpdateStoredProc = "Notify_UpdateNotify";
            FindStoredProc = "Notify_SelectNotifyDynamic";
            GetByIdStoredProc = "Notify_SelectNotify";
            GetPagedStoredProc = "Notify_SelectNotifyPaged";
            GetRowCountStoredProc = "Notify_SelectNotifyRowCount";
        }

        protected override void PopulateInsertParameters(Database db, DbCommand cmd)
        {
            db.AddInParameter(cmd, "Id", DbType.Guid, "Id", DataRowVersion.Current);
            db.AddInParameter(cmd, "FromDept", DbType.AnsiString, "FromDept", DataRowVersion.Current);
            db.AddInParameter(cmd, "FromDeptName", DbType.String, "FromDeptName", DataRowVersion.Current);
            db.AddInParameter(cmd, "ToId", DbType.AnsiString, "ToId", DataRowVersion.Current);
            db.AddInParameter(cmd, "ToName", DbType.String, "ToName", DataRowVersion.Current);
            db.AddInParameter(cmd, "Subject", DbType.String, "Subject", DataRowVersion.Current);
            db.AddInParameter(cmd, "Content", DbType.String, "Content", DataRowVersion.Current);
            db.AddInParameter(cmd, "SendTime", DbType.DateTime, "SendTime", DataRowVersion.Current);
            db.AddInParameter(cmd, "BeginDate", DbType.DateTime, "BeginDate", DataRowVersion.Current);
            db.AddInParameter(cmd, "EndDate", DbType.DateTime, "EndDate", DataRowVersion.Current);
            db.AddInParameter(cmd, "AttachmentSize", DbType.AnsiString, "AttachmentSize", DataRowVersion.Current);
            db.AddInParameter(cmd, "AttachmentName", DbType.String, "AttachmentName", DataRowVersion.Current);
            db.AddInParameter(cmd, "Readers", DbType.String, "Readers", DataRowVersion.Current);
            db.AddInParameter(cmd, "PrintFlag", DbType.AnsiString, "PrintFlag", DataRowVersion.Current);
            db.AddInParameter(cmd, "PrivId", DbType.AnsiString, "PrivId", DataRowVersion.Current);
            db.AddInParameter(cmd, "UserId", DbType.AnsiString, "UserId", DataRowVersion.Current);
            db.AddInParameter(cmd, "TypeId", DbType.AnsiString, "TypeId", DataRowVersion.Current);
            db.AddInParameter(cmd, "TypeName", DbType.String, "TypeName", DataRowVersion.Current);
            db.AddInParameter(cmd, "TopFlag", DbType.AnsiString, "TopFlag", DataRowVersion.Current);
            db.AddInParameter(cmd, "FormatFlag", DbType.AnsiString, "FormatFlag", DataRowVersion.Current);
            db.AddInParameter(cmd, "Publish", DbType.AnsiString, "Publish", DataRowVersion.Current);
            db.AddInParameter(cmd, "AuditerId", DbType.AnsiString, "AuditerId", DataRowVersion.Current);
            db.AddInParameter(cmd, "Reason", DbType.String, "Reason", DataRowVersion.Current);
            db.AddInParameter(cmd, "AuditerDate", DbType.DateTime, "AuditerDate", DataRowVersion.Current);
            db.AddInParameter(cmd, "FromId", DbType.String, "FromId", DataRowVersion.Current);
            db.AddInParameter(cmd, "FromName", DbType.String, "FromName", DataRowVersion.Current);
            db.AddInParameter(cmd, "DeleteFlag", DbType.Int32, "DeleteFlag", DataRowVersion.Current);
        }
    }
}
